package com.cloud.pay.payment;

import com.cloud.pay.entity.PayConfig;
import com.cloud.pay.entity.Payment;
import com.cloud.pay.entity.Refund;
import com.egzosn.pay.common.bean.PayOutMessage;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface PayAdapter {

    void loadConfig(List<PayConfig> list);

    /**
     * 二维码支付
     *
     * @param payment
     * @return
     */
    String getQrcode(Payment payment);

    /**
     * APP内的网页支付
     *
     * @param payment
     * @return
     */
    String orderInfo(Payment payment);

    /**
     * 退款
     *
     * @param refund
     * @return
     */
    boolean refund(Refund refund);

    /**
     * 支付通知回调
     *
     * @param appId
     * @param parameterMap
     * @param input
     * @return
     */
    PayOutMessage payBack(String appId, Map<String, String[]> parameterMap, InputStream input);

}
